package breakcontinue;

import java.util.Scanner;

public class LoginDemo {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		while (true) {
			System.out.println("请输入用户名");
			String name = scan.next();
			System.out.println("请输入密码");
			String pwd = scan.next();
			
			if ("root".equals(name) && "123".equals(pwd)) {
				System.out.println("登录成功");
				break;
			}
		}
	}
}
